<template>
  <Dialog
    :show="dialogConfig.show"
    :title="dialogConfig.title"
    width="400px"
    :showCancel="false"
    @close="dialogConfig.show = false"
  >
    <el-form-item label="群组封面">
      <Image :width="50" :src="formData.icon"/>
    </el-form-item>
    <el-form-item label="群组名称">
      {{ formData.name }}
    </el-form-item>
    <el-form-item label="群组ID号">
      {{ formData.clusterId }}
    </el-form-item>
    <el-form-item label="群主名称">
      {{ formData.ownerName }}
    </el-form-item>
    <el-form-item label="群组人数">
      {{ formData.clusterUserNumber }}
    </el-form-item>
    <el-form-item label="加入方式">
      <el-tag v-if="formData.joinType == 1">验证加入</el-tag>
      <el-tag v-if="formData.joinType == 0">直接加入</el-tag>
    </el-form-item>
    <el-form-item label="是否禁言">
      <el-tag v-if="formData.mute == 1">禁言</el-tag>
      <el-tag v-if="formData.mute == 0">不禁言</el-tag>
    </el-form-item>
    <el-form-item label="群组公告">
      {{ formData.notice }}
    </el-form-item>
  </Dialog>
</template>

<script setup>
import {ref, getCurrentInstance, nextTick} from "vue";

const {proxy} = getCurrentInstance();

const dialogConfig = ref({
  show: false,
  title: "详情",
});

const formData = ref({});
const show = (data) => {
  dialogConfig.value.show = true;
  nextTick(() => {
    formData.value = Object.assign({}, data);
  });
};

defineExpose({show});
</script>

<style scoped>

</style>
